package com.bdf.ipharma.gui;

import java.awt.BasicStroke;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Graphics2D;

import javax.swing.JPanel;

class GUILine extends JPanel {
	 
	private Dimension size;
	
	private Color color;
	
	private BasicStroke basicStroke;
	
	public GUILine(Dimension dimension, Color color){
		this.size=dimension;
		this.color=color;
	}
	
//	public Dimension getPreferredSize() {
//		return new Dimension(240, 50);
//	}
 
	public Dimension getPreferredSize() {
		return this.size;
	}
	
	protected void paintComponent(Graphics g) {
		 Graphics2D graphics = (Graphics2D) g;
		 graphics.setColor( this.color );
		 if(this.getBasicStroke()!=null){
			 graphics.setStroke(this.getBasicStroke());
		 }else{
			 graphics.setStroke(new BasicStroke());
		 }
		 
		// X Start, Y Start, X End, Y End
		// X = <---------->
		 graphics.drawLine(0,0,this.getWidth(),0);
 
	}

	public Dimension getSize() {
		return size;
	}

	public void setSize(Dimension size) {
		this.size = size;
	}

	public Color getColor() {
		return color;
	}

	public void setColor(Color color) {
		this.color = color;
	}

	public BasicStroke getBasicStroke() {
		return basicStroke;
	}

	public void setBasicStroke(BasicStroke basicStroke) {
		this.basicStroke = basicStroke;
	}
	
	
	
}
